package singleton.lanhanshi.safe;

/**
 * @Author： yu.Tan
 * @Date: 2020/10/9 10:05
 * @Description: 懒汉式，线程安全
 */
public class Singleton {
    private static Singleton singleton;

    private Singleton() {
    }

    public static synchronized Singleton getInstance() {
        if (singleton == null) {
            singleton = new Singleton();
        }
        return singleton;
    }
}
